#{extends 'main.html' /}
#{set title:'Mon compte' /}


<div id="leftcolumn">
	<div class="leftcolumnpad">
		<a href="@{Application.moncompte('compte')}">Vos coordonnées</a>
	</div>
	<div class="leftdivider"></div>
	<div class="leftcolumnpad">
		<a href="@{Application.moncompte('trimaran')}">Votre trimaran</a>
	</div>
	<div class="leftdivider"></div>
	<div class="leftcolumnpad">
		<a href="@{Application.moncompte('temps')}">Vos temps</a>
	</div>
</div>

<div id="centandrightcontainer">

<div class="centcolumn">
	<div class="centcolumnpad">
		
		#{if user}
		<h2>Vos coordonnées</h2>
		
		#{form @Application.modifier_compte()}
		        <label class="label_aligne">Login</label><input type="text" name="login" id="login" value="${user.login}" /><br/><br/>
		        <label class="label_aligne">email</label><input type="text" name="email" id="email" value="${user.email}" /><br/><br/>
		        <label class="label_aligne">Nom</label><input type="text" name="nom" id="nom" value="${user.nom}" /><br/><br/>
		        <label class="label_aligne">Prénom</label><input type="text" name="prenom" id="prenom" value="${user.prenom}" /><br/><br/>
		        <label class="label_aligne">Date de naissance</label>
		        <select id="jour_naissance" name="jour_naissance">
		        	#{list 1..31, as:'i' }
					#{if i == user.date_naissance.getDay()}
						<option value="${i}" selected="true">${i}</option>
					#{/if}
					#{else}
						<option value="${i}">${i}</option>
					#{/else}
					#{/list}
		        </select>        
		        <select id="mois_naissance" name="mois_naissance">
		        	#{list 1..12, as:'i' }
					#{if i == user.date_naissance.getMonth()}
						<option value="${i}" selected="true">${i}</option>
					#{/if}
					#{else}
						<option value="${i}">${i}</option>
					#{/else}
					#{/list}
		        </select>
		        <select id="annee_naissance" name="annee_naissance">
		        	#{list 1900..2010, as:'i' }
					#{if i == user.date_naissance.getYear()}
						<option value="${i}" selected="true">${i}</option>
					#{/if}
					#{else}
						<option value="${i}">${i}</option>
					#{/else}
					#{/list}
		        </select>
		        <br/><br/>
		        <label class="label_aligne">Adresse</label><input type="text" name="adresse" id="adresse" value="${user.adresse}" /><br/><br/>
		        <label class="label_aligne">Code Postal</label><input type="text" name="codePostal" id="codePostal" value="${user.code_postal}" /><br/><br/>
		        <label class="label_aligne">Ville</label><input type="text" name="ville" id="ville" value="${user.ville}" /><br/><br/>
		        <label class="label_aligne">Password</label><input type="password" name="password" id="password" value="${user.password}" /><br/><br/>
		        <label class="label_aligne"></label><input type="submit" value="Modifier" />
		#{/form}
		
		#{/if}
			
		#{if trimaran}
		<h2>Votre trimaran</h2>
		
			#{form @Application.modifier_trimaran()}
				<label class="label_aligne">Nom</label><input type="text" name="nom" id="nom" value="${trimaran.nom}" /><br/><br/>
			#{/form}
		#{/if}
		
		#{if temps}
		<h2>Vos temps</h2>
		
		#{/if}
		
	</div>
</div>
